<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts: yield/cont.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">ESP8266ILI9341DisplayProject</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_76a4952186d2aa80a822dd50f57a9a1c.html">yield</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">cont.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="cont_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> cont.h - continuations support for Xtensa call0 ABI</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> Copyright (c) 2014 Ivan Grokhotkov. All rights reserved.</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> This file is part of the esp8266 core for Arduino environment.</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> This library is free software; you can redistribute it and/or</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> modify it under the terms of the GNU Lesser General Public</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> License as published by the Free Software Foundation; either</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> version 2.1 of the License, or (at your option) any later version.</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> This library is distributed in the hope that it will be useful,</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">Lesser General Public License for more details.</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment">You should have received a copy of the GNU Lesser General Public</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment">License along with this library; if not, write to the Free Software</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment">*/</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#ifndef CONT_H_</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="preprocessor">#define CONT_H_</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#include &lt;stdbool.h&gt;</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor">#ifndef CONT_STACKSIZE</span></div><div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="cont_8h.html#a3c0457d493868f331ce63d0ef71aeb3e">   27</a></span>&#160;<span class="preprocessor">#define CONT_STACKSIZE (1024*4)</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;</div><div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="structcont__.html">   30</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structcont__.html">cont_</a></div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;{</div><div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="structcont__.html#a629ed7b6bf785c9027c7fc9eaac32f6e">   32</a></span>&#160;    void (*<a class="code" href="structcont__.html#a629ed7b6bf785c9027c7fc9eaac32f6e">pc_ret</a>)(void);</div><div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="structcont__.html#a2f886d4182bed43aaf66d3a55a2d23b7">   33</a></span>&#160;    <span class="keywordtype">unsigned</span>* <a class="code" href="structcont__.html#a2f886d4182bed43aaf66d3a55a2d23b7">sp_ret</a>;</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="structcont__.html#af0d518438302b7f8629c06c85f5c41ae">   35</a></span>&#160;    void (*<a class="code" href="structcont__.html#af0d518438302b7f8629c06c85f5c41ae">pc_yield</a>)(void);</div><div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="structcont__.html#a59ce8d64c25ff1d02ae24c61080bbf7c">   36</a></span>&#160;    <span class="keywordtype">unsigned</span>* <a class="code" href="structcont__.html#a59ce8d64c25ff1d02ae24c61080bbf7c">sp_yield</a>;</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;</div><div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="structcont__.html#ab6e542a519497e515e2d3a62030a1f61">   38</a></span>&#160;    <span class="keywordtype">unsigned</span>* <a class="code" href="structcont__.html#ab6e542a519497e515e2d3a62030a1f61">stack_end</a>;</div><div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="structcont__.html#ab61b08c26f5251cdb06e9b2173da911f">   39</a></span>&#160;    <span class="keywordtype">unsigned</span> <a class="code" href="structcont__.html#ab61b08c26f5251cdb06e9b2173da911f">unused1</a>;</div><div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="structcont__.html#a4571d78e98dbcf7547ea1dc49c7b7a58">   40</a></span>&#160;    <span class="keywordtype">unsigned</span> <a class="code" href="structcont__.html#a4571d78e98dbcf7547ea1dc49c7b7a58">unused2</a>;</div><div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="structcont__.html#a17c9f5d8bc954cc0381bdbe63d350048">   41</a></span>&#160;    <span class="keywordtype">unsigned</span> <a class="code" href="structcont__.html#a17c9f5d8bc954cc0381bdbe63d350048">stack_guard1</a>;</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;</div><div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="structcont__.html#abc9f985ead0aa2c6795818c0bce6f9c1">   43</a></span>&#160;    <span class="keywordtype">unsigned</span> <a class="code" href="structcont__.html#abc9f985ead0aa2c6795818c0bce6f9c1">stack</a>[<a class="code" href="cont_8h.html#a3c0457d493868f331ce63d0ef71aeb3e">CONT_STACKSIZE</a> / 4];</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;</div><div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="structcont__.html#af9e24c89ac69a95ae78a6c7f8a237da0">   45</a></span>&#160;    <span class="keywordtype">unsigned</span> <a class="code" href="structcont__.html#af9e24c89ac69a95ae78a6c7f8a237da0">stack_guard2</a>;</div><div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="structcont__.html#aa75475b47ca0d3a4a691651402c94fa3">   46</a></span>&#160;    <span class="keywordtype">unsigned</span>* <a class="code" href="structcont__.html#aa75475b47ca0d3a4a691651402c94fa3">struct_start</a>;</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;} <a class="code" href="cont_8h.html#a7d4cc1b0ca5758698479eb6acc2da2c5">cont_t</a>;</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="comment">// Initialize the cont_t structure before calling cont_run</span></div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="keywordtype">void</span> <a class="code" href="cont_8h.html#aabe5fa46dc4aecdcecf7c9ab994967f3">cont_init</a>(<a class="code" href="structcont__.html">cont_t</a>*);</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="comment">// Run function pfn in a separate stack, or continue execution</span></div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="comment">// at the point where cont_yield was called</span></div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="keywordtype">void</span> <a class="code" href="cont_8h.html#a9823dbae01d0e4f8d289e2f478310673">cont_run</a>(<a class="code" href="structcont__.html">cont_t</a>*, <span class="keywordtype">void</span> (*pfn)(<span class="keywordtype">void</span>));</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="comment">// Return to the point where cont_run was called, saving the</span></div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;<span class="comment">// execution state (registers and stack)</span></div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="keywordtype">void</span> <a class="code" href="cont_8h.html#aa800bcad11772d073b3e86c809c14806">cont_yield</a>(<a class="code" href="structcont__.html">cont_t</a>*);</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="comment">// Check guard bytes around the stack. Return 0 in case everything is ok,</span></div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="comment">// return 1 if guard bytes were overwritten.</span></div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;<span class="keywordtype">int</span> <a class="code" href="cont_8h.html#a8795db353c660bc12f083742a906643c">cont_check</a>(<a class="code" href="structcont__.html">cont_t</a>* cont);</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;<span class="comment">// Check if yield() may be called. Returns true if we are running inside</span></div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;<span class="comment">// continuation stack</span></div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="cont_8h.html#a7a8b25ee2153c3033f4590b39197661b">cont_can_yield</a>(<a class="code" href="structcont__.html">cont_t</a>* cont);</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;<span class="preprocessor">#endif                                            </span><span class="comment">/* CONT_H_ */</span><span class="preprocessor"></span></div><div class="ttc" id="structcont___html_a629ed7b6bf785c9027c7fc9eaac32f6e"><div class="ttname"><a href="structcont__.html#a629ed7b6bf785c9027c7fc9eaac32f6e">cont_::pc_ret</a></div><div class="ttdeci">void(* pc_ret)(void)</div><div class="ttdef"><b>Definition:</b> <a href="cont_8h_source.html#l00032">cont.h:32</a></div></div>
<div class="ttc" id="cont_8h_html_aa800bcad11772d073b3e86c809c14806"><div class="ttname"><a href="cont_8h.html#aa800bcad11772d073b3e86c809c14806">cont_yield</a></div><div class="ttdeci">void cont_yield(cont_t *)</div></div>
<div class="ttc" id="structcont___html_abc9f985ead0aa2c6795818c0bce6f9c1"><div class="ttname"><a href="structcont__.html#abc9f985ead0aa2c6795818c0bce6f9c1">cont_::stack</a></div><div class="ttdeci">unsigned stack[CONT_STACKSIZE/4]</div><div class="ttdef"><b>Definition:</b> <a href="cont_8h_source.html#l00043">cont.h:43</a></div></div>
<div class="ttc" id="structcont___html_af9e24c89ac69a95ae78a6c7f8a237da0"><div class="ttname"><a href="structcont__.html#af9e24c89ac69a95ae78a6c7f8a237da0">cont_::stack_guard2</a></div><div class="ttdeci">unsigned stack_guard2</div><div class="ttdef"><b>Definition:</b> <a href="cont_8h_source.html#l00045">cont.h:45</a></div></div>
<div class="ttc" id="cont_8h_html_a3c0457d493868f331ce63d0ef71aeb3e"><div class="ttname"><a href="cont_8h.html#a3c0457d493868f331ce63d0ef71aeb3e">CONT_STACKSIZE</a></div><div class="ttdeci">#define CONT_STACKSIZE</div><div class="ttdef"><b>Definition:</b> <a href="cont_8h_source.html#l00027">cont.h:27</a></div></div>
<div class="ttc" id="cont_8h_html_a8795db353c660bc12f083742a906643c"><div class="ttname"><a href="cont_8h.html#a8795db353c660bc12f083742a906643c">cont_check</a></div><div class="ttdeci">int cont_check(cont_t *cont)</div><div class="ttdef"><b>Definition:</b> <a href="cont__util_8c_source.html#l00036">cont_util.c:36</a></div></div>
<div class="ttc" id="structcont___html_a2f886d4182bed43aaf66d3a55a2d23b7"><div class="ttname"><a href="structcont__.html#a2f886d4182bed43aaf66d3a55a2d23b7">cont_::sp_ret</a></div><div class="ttdeci">unsigned * sp_ret</div><div class="ttdef"><b>Definition:</b> <a href="cont_8h_source.html#l00033">cont.h:33</a></div></div>
<div class="ttc" id="cont_8h_html_a7a8b25ee2153c3033f4590b39197661b"><div class="ttname"><a href="cont_8h.html#a7a8b25ee2153c3033f4590b39197661b">cont_can_yield</a></div><div class="ttdeci">bool cont_can_yield(cont_t *cont)</div><div class="ttdef"><b>Definition:</b> <a href="cont__util_8c_source.html#l00044">cont_util.c:44</a></div></div>
<div class="ttc" id="structcont___html_af0d518438302b7f8629c06c85f5c41ae"><div class="ttname"><a href="structcont__.html#af0d518438302b7f8629c06c85f5c41ae">cont_::pc_yield</a></div><div class="ttdeci">void(* pc_yield)(void)</div><div class="ttdef"><b>Definition:</b> <a href="cont_8h_source.html#l00035">cont.h:35</a></div></div>
<div class="ttc" id="structcont___html_a59ce8d64c25ff1d02ae24c61080bbf7c"><div class="ttname"><a href="structcont__.html#a59ce8d64c25ff1d02ae24c61080bbf7c">cont_::sp_yield</a></div><div class="ttdeci">unsigned * sp_yield</div><div class="ttdef"><b>Definition:</b> <a href="cont_8h_source.html#l00036">cont.h:36</a></div></div>
<div class="ttc" id="structcont___html_a4571d78e98dbcf7547ea1dc49c7b7a58"><div class="ttname"><a href="structcont__.html#a4571d78e98dbcf7547ea1dc49c7b7a58">cont_::unused2</a></div><div class="ttdeci">unsigned unused2</div><div class="ttdef"><b>Definition:</b> <a href="cont_8h_source.html#l00040">cont.h:40</a></div></div>
<div class="ttc" id="cont_8h_html_a9823dbae01d0e4f8d289e2f478310673"><div class="ttname"><a href="cont_8h.html#a9823dbae01d0e4f8d289e2f478310673">cont_run</a></div><div class="ttdeci">void cont_run(cont_t *, void(*pfn)(void))</div></div>
<div class="ttc" id="structcont___html"><div class="ttname"><a href="structcont__.html">cont_</a></div><div class="ttdef"><b>Definition:</b> <a href="cont_8h_source.html#l00030">cont.h:30</a></div></div>
<div class="ttc" id="cont_8h_html_aabe5fa46dc4aecdcecf7c9ab994967f3"><div class="ttname"><a href="cont_8h.html#aabe5fa46dc4aecdcecf7c9ab994967f3">cont_init</a></div><div class="ttdeci">void cont_init(cont_t *)</div><div class="ttdef"><b>Definition:</b> <a href="cont__util_8c_source.html#l00027">cont_util.c:27</a></div></div>
<div class="ttc" id="structcont___html_a17c9f5d8bc954cc0381bdbe63d350048"><div class="ttname"><a href="structcont__.html#a17c9f5d8bc954cc0381bdbe63d350048">cont_::stack_guard1</a></div><div class="ttdeci">unsigned stack_guard1</div><div class="ttdef"><b>Definition:</b> <a href="cont_8h_source.html#l00041">cont.h:41</a></div></div>
<div class="ttc" id="structcont___html_ab6e542a519497e515e2d3a62030a1f61"><div class="ttname"><a href="structcont__.html#ab6e542a519497e515e2d3a62030a1f61">cont_::stack_end</a></div><div class="ttdeci">unsigned * stack_end</div><div class="ttdef"><b>Definition:</b> <a href="cont_8h_source.html#l00038">cont.h:38</a></div></div>
<div class="ttc" id="structcont___html_ab61b08c26f5251cdb06e9b2173da911f"><div class="ttname"><a href="structcont__.html#ab61b08c26f5251cdb06e9b2173da911f">cont_::unused1</a></div><div class="ttdeci">unsigned unused1</div><div class="ttdef"><b>Definition:</b> <a href="cont_8h_source.html#l00039">cont.h:39</a></div></div>
<div class="ttc" id="structcont___html_aa75475b47ca0d3a4a691651402c94fa3"><div class="ttname"><a href="structcont__.html#aa75475b47ca0d3a4a691651402c94fa3">cont_::struct_start</a></div><div class="ttdeci">unsigned * struct_start</div><div class="ttdef"><b>Definition:</b> <a href="cont_8h_source.html#l00046">cont.h:46</a></div></div>
<div class="ttc" id="cont_8h_html_a7d4cc1b0ca5758698479eb6acc2da2c5"><div class="ttname"><a href="cont_8h.html#a7d4cc1b0ca5758698479eb6acc2da2c5">cont_t</a></div><div class="ttdeci">struct cont_ cont_t</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 31 2018 21:22:16 for ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
